Sphinx Alabasterテーマの設定値
#Sphinx_Alabasterテーマ
_static/custom.cssを置いてコードを書かずにCSSを上書きできる
https://alabaster.readthedocs.io/en/latest/customization.html#custom-stylesheet
alabasterの挙動として
build下にもコピーされる
置いていないときは https://github.com/bitprophet/alabaster/blob/0.7.12/alabaster/static/custom.css がコピーされる(コメントがあるだけなので何もしない)
HTMLにもこのCSSを読み込むタグが書かれる
conf.pyのhtml_theme_options(辞書)を使って設定値を上書きできる
https://www.sphinx-doc.org/ja/master/usage/configuration.html#confval-html_theme_options
例:フォントを変える
font_familyを指定すればよい
https://alabaster.readthedocs.io/en/latest/customization.html#fonts
custom.cssでbody上書きだとヘッダーまで一度に当たらない
テンプレート https://github.com/bitprophet/alabaster/blob/0.7.12/alabaster/static/alabaster.css_t の変数を埋めている
変数theme_font_familyはconf.pyのhtml_theme_optionsのfont_familyにて指定できる(と理解)
(裏の仕組みをもっと知りたい)
カスタマイズできるスタイルとしても参照できる
デフォルト値の確認 https://github.com/bitprophet/alabaster/blob/0.7.12/alabaster/theme.conf
ドキュメントにも記載あり
書いた:SphinxのデフォルトテーマAlabasterは驚くほど簡単にカスタマイズできます!(フォントや色の変更、スタイルの上書き)